Copyright: Copyright ©1998 Silicon Joy Software, Inc.


What is a Java Applet?

What is a Java Applet?

Java Applets are small programs designed to run in a web browser.  Typically, they are only a few kilobytes in length and can run in multiple operating systems (Mac OS, Windows, Unix, etc.).  This makes them ideal for use on the Internet.

What are Java Applets used for?

Applets are usually used to add small interactive components (buttons, scrolling text, or a stock ticker) to web pages, but can also be used to make larger programs like a game or word processor.

Related Topics:

  What is a Java Applet?

  What do I need to make an applet work?

  Java .Class Files

  Applet Speed

  Applet Compatibility


What do I need to make an applet work?

You need the Java .class file...

The Java applet usually comes with a .class file (i.e. "joybutton.class" or "button.class").  This file is the Java program and must be on your web site for the applet to work.  The .class file comes with the Applet Button Factory already made and ready for use.  It is called " joybutton.class" and is in the folder which the Button Factory is installed.

You need the Applet's HTML code in your web page…

Just having the .class file on your site isn't enough… you need to put HTML code in the page that will display the applet.  This HTML code is what the Applet Button Factory creates.  It tells the .class file how to customize the applet- what colors and images to use, what size it is, etc.

Here is a sample of the HTML that the Applet Button Factory creates:

<APPLET CODE="joybutton.class" WIDTH=300 HEIGHT=276><PARAM NAME="GENERATOR"VALUE="CREATED WITH THE APPLET BUTTON FACTORY WWW.SILICONJOY.COM"><PARAM NAME="GENERAL"VALUE="0|0|0|000000|1|0|0|40|Loading...|000000|FFFFFF|1|FFFF00"><PARAM NAME="BORDER”VALUE="5|C0C0C0|1|40|0"></APPLET>

As you can see, the applet’s HTML is a complicated mess... please don’t try and alter it or the applet will not work.

To view the HTML created for your applet click the HTML tab in the Button Factory.

Related Topics:

  What is a Java Applet?

  What do I need to make an applet work?

  Java .Class Files

  Applet Speed

  Applet Compatibility


 Java Class Files

What is a .class file?

A Java .class file (i.e. "joybutton.class" or " navigator.class") is the Java program.  An Applet will not work without a .class file in one form or another.  It needs to be on your web site for the Applet to work.

Important things to know about .class files

•	The .class file needs to be on the same server as the HTML page with the applet.  In other words… you cannot have your HTML page at www.here.com and your .class file at www.there.com

•	They need to be transferred to a web site in binary mode.  If your FTP program is not in binary mode the .class file may become corrupted.

•	An unlimited number of applets can run from one .class file.

Related Topics:

  What is a Java Applet?

  What do I need to make an applet work?

  Java .Class Files

  Applet Speed

  Applet Compatibility


Applet Speed

How will an Applet affect the speed of my site?

The Java applet included with the Applet Button Factory is only 13 kilobytes in size.  It is very small and will download in a flash.  So adding an applet to your site will not slow it down very much.  However it will take longer to load the applet if you add large image or sound files to the applet.

Related Topics:

  What is a Java Applet?

  What do I need to make an applet work?

  Java .Class Files

  Applet Speed

  Applet Compatibility


Applet Compatibility

Are Java Applets compatible with all browsers?

No.

Java Applets are compatible with most web browsers... including...

•	Internet Explorer 3

•	Internet Explorer 4 or higher

•	Netscape 2  (not all versions of Netscape 2 support Java)

•	Netscape 3  (not all versions of Netscape 3 support Java- but most do)

•	Netscape 4 or higher

  Alternative HTML

You can add some HTML to be displayed in browsers that do not support Java in the “Advanced” window in the Button Factory.

Related Topics:

  What is a Java Applet?

  What do I need to make an applet work?

  Java .Class Files

  Applet Speed

  Applet Compatibility


Applet Grey Box Problems

Applet Grey Box Problems
When an applet is broken it is usually displayed as a gray box. To find out what is causing the problem you need to follow these steps.

1.	Open the page which has the broken Applet in you web browser (preferably Netscape).

2.	Move the mouse over the gray box (This box will appear where the Applet is supposed to be).

3.	Read the error message in the status bar of the browser. This will tell us what is causing the problem.

This picture shows what the gray box and error message look like in Netscape 4.

4.	After you get the error message look it up below to find out how to fix the problem.

_____________________________________________________________________

Error Message: "Applet joybutton can't start: exception: java.lang.NumberFormatException"

It will look like this in your browser...

Solution: This error is caused by an error in the Applet's HTML code. Follow these steps.

1.	Re-open the applet in the Button Factory.

2.	Copy and paste the HTML into your web page.  Paste it over the HTML of the Applet that is broken.

3.	Save the HTML page, upload it to your server and view it in your web browser.

_____________________________________________________________________

Error Message "Applet joybutton can't start:class joybutton not found"

It will look like this in your browser...

Solution: There can be several causes of this problem. Try the following things.

1.	Make sure the file "joybutton.class" is in the same folder as the HTML page that contains the applet. The applet won't work without this file.

2.	Make sure "joybutton.class" is named EXACTLY "joybutton.class" with NO capitol letters. It must also have the ".class" extension- ".cla" or any other extension will not work.

3.	Try emptying your browsers cache and history folders. 4. If your page has a "<base href="http:www.yoursite.com">" tag it may be causing the applet to look in the wrong folder for the applet. There are two ways to fix this.

1.	Remove the "<base href="http:www.yoursite.com">" tag from your HTML page.

2.	Add a codebase tag to the applet. The codebase tag tells the applet  where to find joybutton.class. The codebase tag looks like this:

codebase="http://www.path_to_joybutton.class"

All you need to do is add it after the <applet code=joybutton.class

tag in your Applet's HTML code.

_____________________________________________________________________

Error Message "Applet joybutton can't start error: java.lang.ClassFormatError"

It will look like this in your browser...

Solution: This error is caused when "joybutton.class” has become corrupted. It is usually caused by transfering it to your web site with your FTP program in ASCII mode instead of binary mode. Switch your FTP program to binary and retransfer "joybutton.class" to your site. If you cannot find a way to do this you may want to try a different FTP program. You can get a good one at  http://www.ftpvoyager.com/.


Nothing Appears Where the Applet Should Be

There could be one of three things causing this:

•	Your browser does not support Java

•	You don’t have an applet on your page

•	Java is not turned on in your browser

Solutions:

1.  Make sure you are using a browser that supports Java. Java Applets are compatible with most web browsers including...

•	Internet Explorer 3

•	Internet Explorer 4 or higher

•	Netscape 2 (not all versions of Netscape 2 support Java)

•	Netscape 3 (not all versions of Netscape 3 support Java- but most do)

•	Netscape 4 or higher

   There is an option in the Marquee wizard that lets you add HTML to be displayed in  non-Java web browsers. This usually solves any compatibility problems with old browsers.

2.  Make sure you copy and pasted the Applet's HTML in the HTML page.

3.  Make sure Java is turned on in your browser. This can be done from your browser’s "options" (Internet Explorer) or "Preferences" (Netscape) window.


General Applet Settings

You can change all of the applet’s background settings on the General Tab of the main window in the Button Factory.

Applet Dimensions

•	Applet Width:  This is the width of the applet in pixels.

•	Applet Height:  This is the height of the applet in pixels.

•	Alignment: This will line align of the buttons horizontally or vertically.

You can also change the width and height of the applet by resizing the applet preview window.

Applet Border

•	Border Width:  This is the width of the applet’s border in pixels. The border width is the same for all sides of the applet.

•	Shading:  Here you can change the rate that the border colors get lighter and darker. It only works when you are using the “Bump” border style.

•	Style:  The Style of the border surrounding the applet.

•	Color:  This button sets the color of the border.

Applet Background

•	Background Image:  Here you can enter the image file that you would like displayed in the background of this applet.

•	Image Alignment:  This lets you change where the background image is positioned in the applet. You can choose from left, right, center, resize,  titled or free alignment.

•	Vertical Position:  When image alignment is set to “Free” you can change the image’s horizontal position by changing this setting.

•	Horizontal Position:  When image alignment is set to “Free” you can change the image’s vertical position by changing this setting.

•	Background Color: This is the background color of the applet.

•	Fade Color:  Here you can change the color that the applet background fades into. Fade color will only work when “Use Gradient Fill” is checked.

•	Use Gradient Fill:  When this is checked the applet’s background will fade from the background color to the fade color.


(Tiled Alignment)
Tiled Alignment

The image will be drawn repetitively until it covers the entire applet background.


Free Alignment

Free alignment lets you position the image anywhere in the applet using the Image X and Image Y controls.


Button Properties

Below are definitions of all controls on the properties window.

To change the properties of an button you must first select it. You select an button by clicking on it in the preview window. You can select more than one button by holding down the “shift” or “control” key while clicking on the button. This will let you change the properties for all of the selected buttons at once.

Example: You select three different buttons, open up the properties window and change the background color to blue. This will change the background color to blue for ALL THREE of the selected buttons.

Dimensions

•	Width:  Width of the button in pixels.

•	Height:  Height of the button in pixels.

•	X:   Where the button appears horizontally in the applet.

•	Y:  Where the button appears vertically in the applet.

Link

•	Link:  This is the URL that the button will link to when it is clicked. You can use a relative URL, emailto: tag, or anchor. It does not work to send a JavaScript command.

•	Frame:  This is the target frame that the link will be opened in. Make sure you use the frame name and not the html page name here.

Status Bar

•	Status Bar Message:  Here you can enter a message to be displayed in the browser status bar when the mouse moves over the button.

Hint

•	Hint:  The text that will be displayed with the button’s pop-up hint.

•	Font:  The font used for the hint.

•	Font Size:  The size of the font.

•	Plain, Bold and Italic Buttons:  Set the style of the text.

•	Font Color:  Click this button to select the font color.

•	Background Color:  Here you can customize the background color of the hint box.

•	Border Color:  Click this button to select the border color of the pop-up hint.

Text

•	Text:  The text that will be displayed.

•	Font:  The font used for the text. There are only 3 available. Sorry! This is a limitation of Java that I can do nothing about!

•	Font Size:  I don’t really need to tell you what this is, do I?

•	Font Color:  Click this button to select the font color.

•	Plain, Bold and Italic Buttons:  Set the style of the text.

•	Left, Right and Center Buttons:  These buttons align the text in the button.

•	Use Shadow: The font shadow is an exact replica of the text on a button printed under the primary font and over one pixel. This gives the text a three dimensional look. Checking this box turns the font shadow on or off.

•	Font Shadow Color: Pressing the “Font Shadow Color” button lets you change the color of the font shadow.

Border

•	Border Width:  This is the width of the button border in pixels. The border width is the same for all sides of the applet.

•	Shading:  Here you can change the rate that the border colors get lighter and darker. It only works when you are using the “Bump” border style.

•	Style:  The Style of the border surrounding the button.

•	Color:  This button sets the color of the border.

Sound

•	Sound:  Enter the sound file name that you want to be used for this button. Only *.au sound files will work – this is a Java limitation.

Highlight Box

•	Show Highlight Box:  The highlight box is a small box which outlines the button. You can turn it on or off by checking this box.

•	Color:  Click this button to change the color of the highlight box.


Free Alignment

Free alignment lets you position the image anywhere in the button using the Image X and Image Y controls.


Tiled Alignment

The image will be drawn repetitively until it covers the entire button background.


Now that you have registered

IMPORTANT!

MAKING UNREGISTERED APPLETS REGISTERED

If have applets that you made with the unregistered version and want to make them registered you need to follow these steps.

1.	Open the applet in the Button Factory.

2.	Re-copy the HTML and paste in your web page.

You DO NOT need to use a different joybutton.classwith registered applets. The same joybutton.class works for both registered and unregistered version.

MAKING APPLETS WORK ON THE WEB

You need to do two ESSENTIAL things to make your applets work on the internet.

1.	Transfer the file joybutton.class and put it on
your web site. Put it in the same folder as the HTML page
with the applet’s HTML. The applet WILL NOT WORK
without this file.

2.	Transfer all of the images and sounds used in this
applet and put them in the same folder as the HTML page
with the applet’s HTML.

NOTE: Make sure your FTP program is in binary mode when you transfer these files.

WHERE IS JOYBUTTON.CLASS

You can find joybutton.class by...

1.	Open the Button Factory.

2.	Click the "HTML" tab.

3.	Click the underlined red text that reads "joybutton.class". This will open a folder containing joybutton.class. You can then copy it to any location that it is needed.


Where is joybutton.class

You can find joybutton.class by...

•	Open the Button Factory

•	Click the "HTML" tab.

•	Click the underlined red text that reads "joybutton.class". This will open a folder containing joybutton.class. You can then copy it to any location that it is needed.


Applet Dimensions

Applet Dimensions

•	Applet Width:  This is the width of the applet in pixels.

•	Applet Height:  This is the height of the applet in pixels.

•	Alignment: This will line align of the buttons horizontally or vertically.

You can also change the width and height of the applet by resizing the applet preview window.


Applet Background

Applet Background

•	Background Image:  Here you can enter the image file that you would like displayed in the background of this applet.

•	Image Alignment:  This lets you change where the background image is positioned in the applet. You can choose from left, right, center, resize,  titled or free alignment.

•	Vertical Position:  When image alignment is set to “Free” you can change the image’s horizontal position by changing this setting.

•	Horizontal Position:  When image alignment is set to “Free” you can change the image’s vertical position by changing this setting.

•	Background Color: This is the background color of the applet.

•	Fade Color:  Here you can change the color that the applet background fades into. Fade color will only work when “Use Gradient Fill” is checked.

•	Use Gradient Fill:  When this is checked the applet’s background will fade from the background color to the fade color.


Applet Border

Applet Border

•	Border Width:  This is the width of the applet’s border in pixels. The border width is the same for all sides of the applet.

•	Shading:  Here you can change the rate that the border colors get lighter and darker. It only works when you are using the “Bump” border style.

•	Style:  The Style of the border surrounding the applet.

•	Color:  This button sets the color of the border.


Button Dimensions

Dimensions

•	Width:  Width of the button in pixels.

•	Height:  Height of the button in pixels.

•	X:   Where the button appears horizontally in the applet.

•	Y:  Where the button appears vertically in the applet.


Highlight Box

•	Show Highlight Box:  The highlight box is a small box which outlines the button. You can turn it on or off by checking this box.

•	Color:  Click this button to change the color of the highlight box.


Button Border

Border

•	Border Width:  This is the width of the button border in pixels. The border width is the same for all sides of the applet.

•	Shading:  Here you can change the rate that the border colors get lighter and darker. It only works when you are using the “Bump” border style.

•	Style:  The Style of the border surrounding the button.

•	Color:  This button sets the color of the border.


Button Text

Text

•	Text:  The text that will be displayed.

•	Font:  The font used for the text. There are only 3 available. Sorry! This is a limitation of Java that I can do nothing about!

•	Font Size:  I don’t really need to tell you what this is, do I?

•	Font Color:  Click this button to select the font color.

•	Plain, Bold and Italic Buttons:  Set the style of the text.

•	Left, Right and Center Buttons:  These buttons align the text in the button.

•	Use Shadow: The font shadow is an exact replica of the text on a button printed under the primary font and over one pixel. This gives the text a three dimensional look. Checking this box turns the font shadow on or off.

•	Font Shadow Color: Pressing the “Font Shadow Color” button lets you change the color of the font shadow.


Button Hint

Hint

•	Hint:  The text that will be displayed with the button’s pop-up hint.

•	Font:  The font used for the hint.

•	Font Size:  The size of the font.

•	Plain, Bold and Italic Buttons:  Set the style of the text.

•	Font Color:  Click this button to select the font color.

•	Background Color:  Here you can customize the background color of the hint box.

•	Border Color:  Click this button to select the border color of the pop-up hint.


Button Status Bar

Status Bar

•	Status Bar Message:  Here you can enter a message to be displayed in the browser status bar when the mouse moves over the button.


Button Sound

Sound

•	Sound:  Enter the sound file name that you want to be used for this button. Only *.au sound files will work – this is a Java limitation.


Button Link

Link

•	Link:  This is the URL that the button will link to when it is clicked. You can use a relative URL, emailto: tag, or anchor. It does not work to send a JavaScript command.

•	Frame:  This is the target frame that the link will be opened in. Make sure you use the frame name and not the html page name here.


Advanced Options

Here you can change the advanced options in the Button Factory.

Alternative HTML

This is where you can enter a html message which will be displayed in browsers that do not support Java.

See Also:

  Applet Compatibility

Loading Message

When the applet is loading images you can have it display a message like… “Please wait… Loading Images.” Or “Loading Files…” You can also change the color of this message and the applet’s background using the “background Color” and “Font Color” buttons in this window.

Background Color

This is the background color that will cover the applet while it is loading.

Font Color

Here you can change the color of the text displayed in the loading message.


Testing Applets

You can test your applet in the selected browser by pressing the “Test in Browser” button on the top left side of the program. If you have problems with testing applets it may be because you installed the Button Factory too far from the root directory of your hard drive… in other words the Button Factory cannot be installed in a directory like:

 “C:\Program Files\Applets\Silicon Joy\Unregistered\New Programs\Applet Button Factory”

Try a shorter path like this:

“C:\Program Files\Applet Button Factory”

Selecting a Browser

From the “Options” menu, choose “Browser” to select the browser that you want to use to test your applet.  Click on the Search for Browsers button to have the Button Factory locate available browsers.  Then select the browser in the list that you want to use to test the applet.


Deploying Applets

The HTML tab of the Button Factory displays everything needed to make your applet work on the Internet (only applets made with the registered version work in the Internet). Here you will find the HTML for the applet and links to the folders containing joybutton.class and all images and sounds used in the applet.

For more in formation on making an applet work on the Internet please see:

  What do I need to make an applet work?

Overview of the HTMLTab

Below you will find an overview of all controls on the “HTML tab” of the Button Factory

Images and Sounds

To open a folder containing all of the images and sounds used in the applet click on the red underlined images and sounds link. After the folder is open you can copy the image and sound files to anyplace you wish to run the applet.

Joybutton.class

If you click on the underlined joybutton.class the folder containing joybutton.class will open. This will let you copy joybutton.class to your web site or any folder that you want to run the applet in.

Copy HTML to Clipboard

Clicking this button copies the applet’s HTML to the clipboard… allowing you to paste it in any HML page.


Button States

Every Button Factory button is made up of three states…
“On Load”, “On Mouse Over” and “On Click”. These states are the three positions a button can be in. For each of these states the button can have a totally different look.

•	On Load:  The button is in the up state when it is first loaded or nothing else is happening to it.

•	On MouseOver: The button goes into this state when the mouse moves over the button.

•	On Click:  The button is in the on click state when the mouse button is clicked over the button.

You can change the way each button looks for each state. You do this in the properties window. There you will find three tabs one for each of the states… “On Load”, “On Mouse Over” and “On Click”. Click on the “On Load” tab if you want to change the buttons settings for the “On Load” state etc.

If you want to make things easier…

At the bottom of the properties window there is a check box which reads:

If you check this box all further changes you make on one state will be automatically copied to the other button states.


Managing Buttons

Creating, Deleting and Duplicating Buttons

You can create, duplicate, delete or change the properties of the selected buttons with the following buttons…

New Button

To create a new button click “New Button” on the “Button” tab of the Button Factory. You can also create a new button by selecting a button and clicking the duplicate button. This will create a new button and copy all of the settings from the selected button to the new button.

Delete Button

You can delete any number of selected buttons by clicking “Delete Button”.

Duplicate Button

This will create a new button and copy all of the settings from the first selected button to the new button.

Properties

Clicking this will let you change the settings (colors, text, links etc.) for all of the selected buttons. If you have one button selected and press the “Properties” button you will be able to change the settings only for the selected button. If you have multiple buttons selected any changes you make to the buttons will apply to all of the selected buttons.

Selecting Multiple Buttons

You can select more than one button by holding down the “shift” or “control” key while clicking on the button. This will let you change the properties for all of the selected buttons at once.

Example: You select three different buttons, open up the properties window and change the background color to blue. This will change the background color to blue for ALL THREE of the selected buttons.


Preview Window

The preview window shows what the applet will look like in your web browser. It also lets you change the arrangement of the buttons and the size of both your buttons and the applet.

Applet Size

You can change the size of the applet by resizing the preview window.

Button Arrangement

You can change arrangement of the buttons by clicking and dragging them anywhere in the preview window.

Button Size

You can change the size of a button by clicking on one of its sides or corners and dragging it.

Right Clicking

You can also right click on a button to change its properties or create, delete, duplicate or rename a button.


Button Background

•	Background Image:  Here you can enter the image file that you would like displayed in the background of this button.

•	Image Alignment:  This lets you change where the background image is positioned in the button. You can choose from left, right, center, tiled or free alignment.

•	Image X:  When image alignment is set to “Free” you can change the image’s horizontal position by changing this setting.

•	Image Y:  When image alignment is set to “Free” you can change the image’s vertical position by changing this setting.

•	Background Color: This is the background color of the button.

•	Fade Color:  Here you can change the color that the button background fades into. Fade color will only work when “Use Gradient Fill” is checked.

•	Gradient Fill:  When this is checked the button’s background will fade from the background color to the fade color.

•	Transparent:  This will make the background of the button invisible and let the applet’s background show through the button. However, it will not show other buttons if they are layered on top of each other.